package com.rmt.www.serviceImpl;

import java.util.List;

import com.rmt.www.dao.UserDao;
import com.rmt.www.service.AdminManageUserService;
import com.rmt.www.vo.User;

public class AdminManageUserServiceImpl implements AdminManageUserService {

	private UserDao userDao;
	
	public void addNewUser(User newUser) {
		userDao.insert(newUser);
	}

	public void deleteUsers(List<Integer> idList) {
		for (int id : idList) {
			userDao.deleteUserById(id);
		}
	}

	public User getUserByName(String name) {
		return userDao.getUser(name);
	}

	public List<User> getUserList() {
		return userDao.getUserList();
	}

	public void updateUser(User newUser) {
		userDao.updateUser(newUser);
	}

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

}
